package com.xioaming.coupon.dao;

import com.xioaming.coupon.constant.CouponStatus;
import com.xioaming.coupon.entity.Coupon;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author jxbai
 * @desc coupon dao 接口定义
 * @date 2020/6/9
 */
public interface CouponDao extends JpaRepository<Coupon, Integer> {

    /**
     * 根据 userrd  和状态寻找优惠券记录
     * @param userId
     * @param status
     * @return
     */
    List<Coupon> findAllByUserIdAndStatus(Long userId, CouponStatus status);
}
